home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-02 | 1.2 KB | 38 lines | [TEXT/MMCC] |
- /*
- File: LinkedList.cp
-
- Contains: A linked list
- Written by: Dave Mark
- Copyright: © 1994 by Dave Mark, all rights reserved.
- */
-
- #include "Link.h"
-
- // TOPIC: Mention singly linked list idea from Scott, where you
- // cinch the singly linked list by copying the next element into the to-be-deleted-element, then
- // fix the pointers, then delete the next elemenbt instead.
- // Note that this strategy requires you to keep a semaphore link as the last link in the list and
- // that you can't del;ete the semaphore link.
-
- // TOPIC: The reader should investigate Enque() and Deque(), especially if you
- // need your linked list to operate at inturrupt time, which is likely if you are doing a lot
- // of async processing, as you might do if you were
- // writing a web server or some such.
- // You might implement this as a series of three queues: a queue of preallocated queue elements,
- // (so you don't yhave to allocate memory at interrupt time)
- // another queue of "in-progress" elements (async reads waiting to complete)
- //
- // also a queue of "this is done, take care of it at main-event time"
- //
-
- TLink::TLink( void *objectPtr )
- {
- fObjectPtr = objectPtr;
- fPrevLinkPtr = nil;
- fNextLinkPtr = nil;
- }
-
-
- TLink::~TLink()
- {
- }